<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浙江外国语学院“三位一体”综合评价招生系统</title>
    <link href="assets/css/site.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/public.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/fa47/css/font-awesome.css" rel="stylesheet" type="text/css" />
    <!-- 新 Bootstrap5 核心 CSS 文件 -->
    <link rel="stylesheet"
        href="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/twitter-bootstrap/5.1.3/css/bootstrap.min.css">

    <!--  popper.min.js 用于弹窗、提示、下拉菜单 -->
    <script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/popper.js/2.11.2/umd/popper.min.js"></script>

    <!-- 最新的 Bootstrap5 核心 JavaScript 文件 -->
    <script
        src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/twitter-bootstrap/5.1.3/js/bootstrap.min.js"></script>
    <style type="text/css">
    </style>
    <script src="assets/js/jquery2-1.min.js"></script>
    <script src="assets/js/layer/layer.js"></script>
    <script>
        $(document).ready(function () {
            if(localStorage.getItem("loginFlag")==null){
                $("#areaInit").show();
                $("#areaLogined").hide();
                $("#lbUserName").text("");
                $("#loginedTxt").text("考生登录");
            }else{
                $("#areaInit").hide();
                $("#areaLogined").show();
                $("#lbUserName").text(localStorage.getItem("userName"));
                $("#loginedTxt").text("个人中心");
            }
            console.log(localStorage.getItem("loginFlag"));
            console.log(localStorage.getItem("userName"));
            //获取当前浏览器窗口中的地址栏中的地址
            var currentUrl=window.location.href;
            //判断地址中是否包含导航对应的板块名称，indexOf用来查找是否包含子串，如果有则返回子串的首字母位置索引
            if(currentUrl.indexOf("home")>=0){
                //给当前板块的导航项添加一个名为active的class
                $(".home").addClass("active");
            }
            if(currentUrl.indexOf("zsgg")>=0){
                $(".zsgg").addClass("active");
            }
            // $(".stuAreaTitle").click(function () {
            //     $(".stuAreaContent").slideToggle(5000, function () {
            //         console.log("完成");                    
            //     });
            // })
            //访问获取新闻标题列表的接口
            $.ajax({
                url:"http://kjxycode.zisu.edu.cn/InterfaceCommonForNews/GetNewsTitleList",
                data:{token:"kjxy_Interface_2025"},
                type:"post",
                dataType:"json",
                success:function(e){
                    var newsTitleList=e.newsTitleList;
                    var htmlStr="";
                    for(var i=0;i<20;i++){
                        htmlStr+="<li>";
                        htmlStr+="<span class='lbNewsTitle'>";
                        htmlStr+="<a href='#'>"+newsTitleList[i].newsTitle+"</a>";
                        htmlStr+="</span>";
                        htmlStr+="<span class='lbNewsOther'>";
                        htmlStr+="<span class='lbNewsClickNum'>"+newsTitleList[i].newsClickNum+" | </span>";
                        htmlStr+="<span class='lbNewsTime'>2025-04-23</span>";
                        htmlStr+="</span>";
                        htmlStr+="</li>";                        
                    }
                    $("#ulNewsTitleList").html(htmlStr);
                }
            })
            $("#btnExit").click(function(){
                localStorage.clear();
                window.location.reload();
            })
            $("#formLogin").submit(function(){
                //利用ajax的方式提交表单里的数据
                $.ajax({
                    "url":"http://kjxycode.zisu.edu.cn/InterfaceCommonForUser/CheckUserLogin",
                    "type":"post",
                    "data":{
                        "userPhone":$("#tbPhone").val(),
                        "userPWD":$("#tbPWD").val(),
                        "token":"kjxy_Interface_2025"
                    },
                    "dataType":"json",
                    success:function(e){
                        if(e.status==600){
                            layer.alert(e.userName+"登录成功！",{icon:6});
                            $("#areaInit").hide();
                            $("#areaLogined").show();
                            $("#lbUserName").text(e.userName);
                            $("#loginedTxt").text("个人中心");
                            localStorage.setItem("loginFlag",true);
                            localStorage.setItem("userName",e.userName)
                        }else{
                            layer.alert("登录失败【"+e.status+"】【"+e.msg+"】",{icon:5});
                        }
                    }
                });
                //阻止当前表单自身的提交行为
                return false;
            })
        })
    </script>
</head>
<body>
    <!--这是最顶部的LOGO区域和导航区域-->
    <div class="nav-bar">
        <div class="nav">
            <div class="logo">
                <img src="assets/img/logo.png" />
            </div>
            <div class="nav-items">
                <ul>
                    <li><a class="home" href="default.html?area=home">网站首页</a></li>
                    <li><a class="zsgg" href="default.html?area=zsgg">招生公告</a></li>
                    <li><a class="bkzn" href="default.html?area=bkzn">报考指南</a></li>
                    <li><a class="zysx" href="default.html?area=zysx">注意事项</a></li>
                    <li><a class="bgxz" href="default.html?area=bgxz">表格下载</a></li>
                    <li><a class="lxzb" href="index.html" target="_blank">联系招办</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div style="width:100%;height:100px;"></div>

    <div class="banner">
        <div class="bannerTxt">
            浙江外国语学院2025年三位一体综合评价招生章程
        </div>
    </div>
    <!--这里是主要内容区-->
    <div class="mainContainer">
        <div class="newsArea">
            <div class="newsAreaTitle">
                <div class="txt">焦点新闻</div>
                <div class="link">
                    <a href="#">更多&gt;&gt;</a>
                </div>
            </div>
            <div class="newsListArea">
                <ul id="ulNewsTitleList">
                    
                </ul>
            </div>
        </div>
        <div class="stuArea">
            <div class="stuAreaTitle">
                <div id="loginedTxt" class="txt">考生登录</div>
            </div>
            <div id="areaInit" class="stuAreaContent">
                <form id="formLogin" action="#" method="post">
                    <div>手机号：</div>
                    <div>
                        <input id="tbPhone" type="text" name="tbName" placeholder="请输入手机号" />
                    </div>
                    <div>密码：</div>
                    <div>
                        <input id="tbPWD" type="password" name="tbPwd" />
                    </div>
                    <div>验证码</div>
                    <div>
                        <input id="tbCode" type="text" name="tbCode" />
                        <img src="assets/img/validCode.gif" />
                    </div>
                    <div>
                        <button type="button">
                            我要注册
                        </button>
                        <button>
                            我要登录
                        </button>
                    </div>
                </form>
            </div>
            <div id="areaLogined" class="stuAreaContent hide">
                <div>
                    欢迎您：<span id="lbUserName">XXX</span>
                    <button id="btnExit" type="button" class="btn btn-sm btn-success">退出</button>
                </div>
                <div><a href="#">进入个人中心</a></div>
            </div>
        </div>
        <div class="linkArea">
            <i class="fa fa-user-plus"></i>
        </div>
        <div class="contactArea"></div>
    </div>
    </div>
</body>

</html>